const Sequelize = require('sequelize');
// 表名称 用户名 密码
const sequelize = new Sequelize('user', 'root', '', {
	host: 'localhost',
	dialect: 'mysql',
	pool: {
		max: 5,
		min: 0,
		acquire: 30000,
		idle: 10000
	},
	// 仅限 SQLite
	//storage: 'path/to/database.sqlite'
});
//测试sepuelize连接数据库是否成功
sequelize
	.authenticate()
	.then(() => {
		console.log('已连上数据库');
	}).catch(err => {
	console.error('Unable to connect to the database:', err);
});
global.sequelize =sequelize;